package org.pupil.common;

import io.netty.util.concurrent.Promise;

/**
 * @Description: 异步监听器
 * @Author: pupil
 * @Date: 2024/07/09 下午 3:03
 */
public class RpcFuture<T> {

    private Promise<T> promise; // 两个线程间传递结果的容器
    private long timeOut; // 异步操作等待超时时间

    public RpcFuture(Promise<T> promise, long timeOut) {
        this.promise = promise;
        this.timeOut = timeOut;
    }

    public Promise<T> getPromise() {
        return promise;
    }

    public void setPromise(Promise<T> promise) {
        this.promise = promise;
    }

    public long getTimeOut() {
        return timeOut;
    }

    public void setTimeOut(long timeOut) {
        this.timeOut = timeOut;
    }
}
